<template>
	<aplid-dialog
		@close="onClose"
		width="85%"
		v-model="visibleForm"
		append-to-body
		whickComm="Archives"
		:customeHeader="customeHeader"
			:model="{...nowRowInfo,...detailHeadData}"
	>
		<transition name="fade" mode="out-in">
			<div class="dialog-content w-100" v-show="!Loading">
				<oldmanArchives :showBtn="false" :nowRowData="nowRowInfo"></oldmanArchives>
			</div>
		</transition>
		<PageLoading v-if="Loading" />
	</aplid-dialog>
</template>

<script setup lang="ts">
import { useCommonStore } from '@/stores/common'
import oldmanArchives from '@/views/datacenter/basicData/oldman/components/Archives/index.vue'
import apiMod from '@/apiMod'

const { setTempParams, setGloablParams, setMoreSearch } = useCommonStore()
const { Loading ,detailHeadData} = storeToRefs(useCommonStore())
const visibleForm = ref(false)
const nowRowInfo = ref({})
const customeHeader = {
		integrityConfig: {
			baseTableName: 'dp_service_object',
			materialTableName: 'dp_service_object_material',
			soleValue: 'idCard',
		},
		type: 'CardTwo',
		title: 'name',
		avatar: 'image',
		tipList: [{ prop: 'telephone', type: 'tip-success', label: '联系电话' }],
		tagList: [
			{
				prop: 'countryLevel',
				propName: 'countryLevelLabel',
				code: 'ACCESS_LEVEL_COUNTRY',
				custome: 'tag',
				type: 'success',
				label: '能力等级',
			},
			{ prop: 'birthday', type: 'success', label: '公历' },
			{ prop: 'lunarBirthday', type: 'success', label: '农历' },
		],
		menuBtn: [],
}

const onClose = () => {
	setTempParams({})
	setGloablParams({})
	setMoreSearch({})
  visibleForm.value = false
}

const getBaseInfo = (idCard) => {
	if (!idCard) return
  nowRowInfo.value = {
    idCard
  }
	visibleForm.value = true
}

defineExpose({
  getBaseInfo
})
</script>

<style scoped></style>
